<template>
    <div class="wrap">
      <div class="imgBox" @click="hideGallary">
        <swiper :options="swiperOptions">
          <!-- slides -->
          <swiper-slide v-for="(item, index) of imgs"
                        :key="index"
          >
            <img :src='item' alt="">
          </swiper-slide>
          <!-- Optional controls -->
          <div class="swiper-pagination" slot="pagination"></div>
        </swiper>
      </div>
    </div>
</template>

<script>
export default {
  name: '',
  props: {
    imgs: Array
  },
  data () {
    return {
      swiperOptions: {
        pagination: '.swiper-pagination',
        paginationType: 'fraction',
        observeParents: true,
        observer: true
      }
    }
  },
  methods: {
    hideGallary () {
      this.$emit('hideGallary')
    }
  }
}
</script>

<style lang='stylus' scoped>
  .imgBox >>> .swiper-container {
    overflow: inherit
  }
  .wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: #000;
    z-index: 999;
    .imgBox {
      width: 100%;
      height: 0;
      padding-bottom: 100%;
      img {
        width: 100%;
      }
      .swiper-pagination {
        font-size: 32px;
        color: #fff;
        bottom: -60px;
      }
    }
  }
</style>
